<template>
  <div class="home">
    <div class="hero">
      <h1>欢迎来到Vue2路由案例</h1>
      <p>这是一个简单的Vue2 + Vue Router项目演示</p>
      <button @click="goToProducts" class="cta-button">查看产品</button>
    </div>
    
    <div class="features">
      <h2>项目特性</h2>
      <div class="feature-grid">
        <div class="feature-card">
          <h3>🚀 Vue2框架</h3>
          <p>使用Vue2构建的现代化单页应用</p>
        </div>
        <div class="feature-card">
          <h3>🛣️ Vue Router</h3>
          <p>实现页面路由和导航功能</p>
        </div>
        <div class="feature-card">
          <h3>📱 响应式设计</h3>
          <p>适配各种设备屏幕尺寸</p>
        </div>
        <div class="feature-card">
          <h3>⚡ 快速开发</h3>
          <p>简洁的项目结构，易于扩展</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'Home',
  methods: {
    goToProducts() {
      this.$router.push('/products')
    }
  }
}
</script>

<style scoped>
.home {
  text-align: center;
}

.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4rem 2rem;
  border-radius: 8px;
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

.cta-button {
  background: #fff;
  color: #667eea;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: 25px;
  cursor: pointer;
  transition: transform 0.3s;
}

.cta-button:hover {
  transform: translateY(-2px);
}

.features h2 {
  margin-bottom: 2rem;
  color: #2c3e50;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}

.feature-card:hover {
  transform: translateY(-5px);
}

.feature-card h3 {
  color: #2c3e50;
  margin-bottom: 1rem;
}
</style>
